import { IsNumber, IsNotEmpty, IsBoolean, IsDate } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { User } from 'src/user/entities/user.entity';
import { Goods } from 'src/goods/entities/goods.entity';

export class CreateFavoriteDto {
  @ApiProperty({ description: '商品ID', example: 1 })
  @IsNumber()
  @IsNotEmpty()
  goodsId: number;

  @ApiProperty({ description: '用户ID', example: 1 })
  @IsNumber()
  @IsNotEmpty()
  userId: number;

  @ApiProperty({ description: '创建时间', example: new Date() })
  @IsDate()
  @IsNotEmpty()
  createdAt: Date;

  @ApiProperty({ description: '更新时间', example: new Date() })
  @IsDate()
  @IsNotEmpty()
  updatedAt: Date;

  @ApiProperty({ description: '是否删除', example: false })
  @IsBoolean()
  @IsNotEmpty()
  isDeleted: boolean;

  @ApiProperty({ description: '商品', type: Goods })
  @IsNotEmpty()
  goods: Goods;

  @ApiProperty({ description: '用户', type: User })
  @IsNotEmpty()
  user: User;
}
